﻿<Window x:Class="AnnotationDemo.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:oxy="clr-namespace:OxyPlot.Wpf;assembly=OxyPlot.Wpf" xmlns:OxyPlot="clr-namespace:OxyPlot;assembly=OxyPlot"
        Title="AnnotationDemo" Height="480" Width="640">
    <TabControl>
        <TabItem Header="ArrowAnnotation">
            <oxy:PlotView Title="ArrowAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:ArrowAnnotation Color="Green" Text="Arrow 1">
                        <oxy:ArrowAnnotation.StartPoint>
                            <OxyPlot:DataPoint X="10" Y="10"/>
                        </oxy:ArrowAnnotation.StartPoint>
                        <oxy:ArrowAnnotation.EndPoint>
                            <OxyPlot:DataPoint X="60" Y="30"/>
                        </oxy:ArrowAnnotation.EndPoint>
                    </oxy:ArrowAnnotation>

                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
        <TabItem Header="EllipseAnnotation">
            <oxy:PlotView Title="EllipseAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:EllipseAnnotation Text="EllipseAnnotation1" X="50" Y="50" Width="20" Height="10"/>
                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
        <TabItem Header="LineAnnotation">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <oxy:PlotView Title="Linear axes">
                    <oxy:PlotView.Axes>
                        <oxy:LinearAxis Position="Bottom" Minimum="-20" Maximum="80" />
                        <oxy:LinearAxis Position="Left" Minimum="-10" Maximum="10" />
                    </oxy:PlotView.Axes>
                    <oxy:PlotView.Annotations>
                        <oxy:LineAnnotation Slope="0.1" Intercept="1" Text="First" />
                        <oxy:LineAnnotation Slope="0.3" Intercept="2" MaximumX="40" Color="Red" Text="Second" />
                        <oxy:LineAnnotation Type="Vertical" X="4" MaximumY="10" Color="Green" Text="Vertical" />
                        <oxy:LineAnnotation Type="Horizontal" Y="2" MinimumX="0" Color="Gold" Text="Horizontal" />
                    </oxy:PlotView.Annotations>
                </oxy:PlotView>
                <oxy:PlotView Grid.Column="1" Title="Logarithmic axes">
                    <oxy:PlotView.Axes>
                        <oxy:LogarithmicAxis Position="Bottom" Minimum="1" Maximum="100" />
                        <oxy:LogarithmicAxis Position="Left" Minimum="1" Maximum="100" />
                    </oxy:PlotView.Axes>
                    <oxy:PlotView.Annotations>
                        <oxy:LineAnnotation Slope="0.1" Intercept="1" Text="First" />
                        <oxy:LineAnnotation Slope="0.3" Intercept="2" MaximumX="40" Color="Red" Text="Second" />
                        <oxy:LineAnnotation Type="Vertical" X="4" MaximumY="10" Color="Green" Text="Vertical" />
                        <oxy:LineAnnotation Type="Horizontal" Y="2" MinimumX="0" Color="Gold" Text="Horizontal" />
                    </oxy:PlotView.Annotations>
                </oxy:PlotView>
            </Grid>
        </TabItem>
        <TabItem Header="PointAnnotation">
            <oxy:PlotView Title="PointAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:PointAnnotation Text="P1" X="50" Y="50"/>
                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
        <TabItem Header="PolygonAnnotation">
            <oxy:PlotView Title="PolygonAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:PolygonAnnotation Text="PolygonAnnotation1"  Points="{Binding Points}"/>
                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
        <TabItem Header="PolylineAnnotation">
            <oxy:PlotView Title="PolylineAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:PolylineAnnotation Text="PolylineAnnotation1"  Points="{Binding Points}"/>
                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
        <TabItem Header="RectangleAnnotation">
            <oxy:PlotView Title="RectangleAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:RectangleAnnotation Fill="IndianRed" Text="Rectangle 1" MinimumX="10" MinimumY="10" MaximumX="60" MaximumY="40"/>
                    <oxy:RectangleAnnotation Fill="#40004684" Text="Rectangle 2" MinimumX="20" MinimumY="30" MaximumX="50" MaximumY="60"/>
                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
        <TabItem Header="TextAnnotation">
            <oxy:PlotView Title="TextAnnotation">
                <oxy:PlotView.Axes>
                    <oxy:LinearAxis Position="Bottom" Minimum="0" Maximum="100" />
                    <oxy:LinearAxis Position="Left" Minimum="0" Maximum="100" />
                </oxy:PlotView.Axes>
                <oxy:PlotView.Annotations>
                    <oxy:TextAnnotation TextColor="Green" Text="Hello">
                        <oxy:TextAnnotation.TextPosition>
                            <OxyPlot:DataPoint X="30" Y="70"/>
                        </oxy:TextAnnotation.TextPosition>
                    </oxy:TextAnnotation>
                    <oxy:TextAnnotation TextColor="Orange" Text="world!" TextRotation="20">
                        <oxy:TextAnnotation.TextPosition>
                            <OxyPlot:DataPoint X="50" Y="70"/>
                        </oxy:TextAnnotation.TextPosition>
                    </oxy:TextAnnotation>
                </oxy:PlotView.Annotations>
            </oxy:PlotView>
        </TabItem>
    </TabControl>
</Window>